home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / CC_C / 1116.ZIP / TOOLKIT.ARC / STRING.C < prev    next >
Text File  |  1979-12-31  |  461b  |  20 lines

  1.  
  2. #include string.h
  3. #include stdio.h
  4.  
  5. main()
  6.       {
  7.         char in[81],insub[81]; int x,z;
  8.         x = z = 0;
  9.         puts("Enter a string: "); gets(in);
  10.         z = strlen(in,z); puts("String length = ");
  11.         printf("%d",z); putchar(13);
  12.         puts("Enter a substring to search for: "); gets(insub);
  13.         x = strpos(in,insub,x);
  14.         puts("Starting position of substring is: ");
  15.         printf("%d",x); putchar(13);
  16.       }
  17.  
  18.  
  19.  
  20.